Skip to content

feat(notifications): trigger notifications on follow, message, and ap…#220

Merged
1 commit merged into
nensii21:mainfrom
GitGuru-sudo:feature/wire-notifications
Jul 10, 2026
Merged

feat(notifications): trigger notifications on follow, message, and ap…#220
1 commit merged into
nensii21:mainfrom
GitGuru-sudo:feature/wire-notifications

Conversation

@GitGuru-sudo

Copy link
Copy Markdown
Contributor

Pull Request

Summary

Wire the existing create_notification service into real application events (follow, message, application create/accept/reject) so notifications work end-to-end, synchronously. Adds the missing notification Pydantic schema and a NotificationService.notify helper with a self-notification guard.


Related Issue

Part of #161 (ECSoC 2026)


Type of Change

  • Bug fix
  • New feature
  • Documentation update
  • Performance improvement
  • Refactoring
  • UI/UX enhancement
  • Tests
  • Other

Changes Made

  • Create backend/app/schemas/notification.py — was missing, imported by existing router and service
  • Add notify() static method to NotificationService — never notifies the actor, never breaks the primary action
  • Wire follow_userFOLLOW notification to the followed user
  • Wire send_messageMESSAGE notification to all other conversation members
  • Wire create_applicationAPPLICATION notification to the project owner
  • Wire accept_application / reject_applicationAPPLICATION_ACCEPTED / APPLICATION_REJECTED to the applicant (added current_user dependency to both endpoints)
  • Create backend/tests/test_notifications_events.py — 3 tests

Screenshots (if applicable)

N/A — backend-only change.


Testing

  • Tested locally
  • Existing tests pass
  • Added new tests
  • UI verified
  • Cross-browser tested (if applicable)

Additional testing notes: Tested with SQLite in-memory via TestClient. Celery/Redis async delivery is explicitly deferred to PR 2.


Checklist

  • My code follows the project's coding standards.
  • I have tested my changes locally.
  • I have updated the documentation where necessary.
  • My changes do not introduce new warnings or errors.
  • I have reviewed my own code.
  • This pull request focuses on a single feature or fix.
  • I have linked the related issue.

Additional Notes

Pre-existing breakage (out of scope): main.py imports three routers that don't exist on disk (builders, builder_flare—singular mismatch, ai). Local stubs were used for testing. Flagged in issue #161.

Event → Notification type map:

Event Endpoint Recipient Type
New follower POST /followers/{user_id} followed user FOLLOW
Message sent POST /messages/ other conversation members MESSAGE
New application POST /applications/ project owner APPLICATION
Application accepted PATCH /applications/{id}/accept applicant APPLICATION_ACCEPTED
Application rejected PATCH /applications/{id}/reject applicant APPLICATION_REJECTED

…plication events

Wire the existing create_notification service into real events (new follower,
message received, application created/accepted/rejected) so notifications work
end-to-end. Adds the missing notification schema and a NotificationService.notify
helper that never notifies the actor and never breaks the primary action.
Celery/Redis async delivery is intentionally left for a follow-up PR.

Part of nensii21#161 (ECSoC 2026).

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉 Thank you for your first Pull Request to DevLink!

We appreciate your contribution to our open-source community.

Before your PR is reviewed, please ensure:

  • ✅ The project builds successfully.
  • ✅ Your code follows the project's coding standards.
  • ✅ You have tested your changes.
  • ✅ Related documentation has been updated if necessary.

Our maintainers will review your PR as soon as possible.

Thank you for helping improve DevLink! 💙

@nensii21

nensii21 commented Jul 9, 2026

Copy link
Copy Markdown
Owner

add screenshots and videos showing what changes have been made and also your CI jobs are failing please update it.

@GitGuru-sudo

Copy link
Copy Markdown
Contributor Author
image @nensii21 these are seeded data

@nensii21 nensii21 closed this pull request by merging all changes into nensii21:main in 1efef24 Jul 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants